/** @format */

import { Outlet, createRootRoute, redirect } from '@tanstack/react-router'
import AppLayout from '../layouts/AppLayout'

export const Route = createRootRoute({
  component: RootComponent,
})

function RootComponent() {
  // const user = userStore((state) => state.user);
  // const navigate = useNavigate();

  // useEffect(() => {
  //   if (!user) {
  //     navigate({ to: "/login" });
  //   }
  // }, [user, navigate]);
  redirect({ to: '/error' })
  return (
    <>
      <AppLayout>
        <Outlet />
      </AppLayout>
    </>
  )
}
